<?php
/**
 * CreateTime: 2023/7/13 17:45
 */

namespace App\Http\Controllers\Admin\AdminStaff;

use App\Consts\ResponseConsts\ResponseStatusConsts;
use App\Func\AdminTokenFunc;
use App\Func\ResponseFunc;
use App\Models\AdminStaff\AdminStaffModel;

class AdminStaffController
{
    public function getCurrentAdminStaffInfo(){
        $adminToken = (new AdminTokenFunc());
        $currentInfo = $adminToken->getUkTInfo();

        $adminStaffModel = new AdminStaffModel();
        $adminStaffInfo = $adminStaffModel->select([
            'admin_id',
            'company_id',
            'name',
            'phone_number',
            'created_time',
            'updated_time',
            'last_login_time',
            'email',
        ])->where('admin_id',$currentInfo['admin_id'])
        ->where('company_id',$currentInfo['company_id'])
        ->first();
        return ResponseFunc::returnJson(
            'ok',
            $adminStaffInfo,
            '获取管理员详情成功',
            ResponseStatusConsts::OK_200_RESPONSE_STATUS
        );
    }
}